Skip to content

Conversation

@brownchow
Copy link

I noticed that, if I build from source, the current working directory will generate a target, and it's huge

~/rust/github.com/vi/websocat(master) » du -sh target                                                                                                                                                                              
370M    target

so, if we have already compiled the source code, and then execute docker build -t vi/websocat:v0.1 ., it will send a huge build context to docker daemon, that will slow down our build speed.

docker build -t v1/websocat:v0.1 .                                                                                                                                                        
Sending build context to Docker daemon  385.5MB
Step 1/12 : FROM rust:1.45.0 as cargo-build
........

but when we ignore target dir, the context send to docker daemon is small

docker build -t v1/websocat:v0.1 .                                                                                                                                                        
Sending build context to Docker daemon  1.578MB
Step 1/12 : FROM rust:1.45.0 as cargo-build
 ---> cbcfc3836acd
Step 2/12 : RUN apt-get update &&     apt-get install -y --no-install-recommends musl-tools
.......

that will speed up build progress.

@vi vi force-pushed the master branch 2 times, most recently from 00113dc to 9ab5e4a Compare May 17, 2022 21:20
@akostadinov
Copy link
Contributor

Is this still useful? I see .dockerignore was added already just without the md part.

@brownchow brownchow closed this by deleting the head repository Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants